package com.heima.comment.pojo;


import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * @Author Xanny
 * @Data 2024/8/22 20:41
 * @Version 1.0
 */

//文章评论
@Document(collection="leadnews-comment")
@Data
public class ArticleComment implements Serializable {
    //主键标识，该属性的值会自动对应mongodb的主键字段"_id"，如果该属性名就叫“id”,则该注解可以省略，否则必须写
    @Id
    private String id;
    //该属性对应mongodb的字段的名字，如果一致，则无需该注解
    @Indexed
    //发布人ID
    private Long authorId;
    //昵称
    private String authorName;

    //文章ID
    private Long entryId;

    //文章ID
    private Long articleId;

    private Integer type;
    //吐槽内容
    @Field("content")
    private String content;
    //用户发布的图片
    private String image;
    //发布日期
    private Date publishTime;

    //记录该用户是否点赞
    private Integer operation;

    //评论的日期时间
    private LocalDateTime createdTime;

    //评论的更新时间
    private LocalDateTime updatedTime;
    //点赞数
    private Integer likes;
    //回复数
    private Integer reply;
    //状态
    private Integer flag;

    private Integer ord;
}